﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <ControlTemplate x:Key="DefaultErrorTemplate">
            <Grid x:Name="container">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <AdornedElementPlaceholder Grid.Column="0"
										   Name="customAdorner"
										   VerticalAlignment="Center">
                </AdornedElementPlaceholder>
                <Border x:Name="ValidationErrorElement"
						BorderBrush="#FFDB000C"
						BorderThickness="1"
						CornerRadius="1"
						ToolTip="{Binding ElementName=customAdorner, Path=AdornedElement.(Validation.Errors)[0].ErrorContent}">
                    <Grid Background="Transparent"
						  HorizontalAlignment="Right"
						  Height="12"
						  Margin="1,-4,-4,0"
						  VerticalAlignment="Top"
						  Width="12">
                        <Path Data="M 1,0 L6,0 A 2,2 90 0 1 8,2 L8,7 z"
							  Fill="#FFDC000C"
							  Margin="1,3,0,0" />
                        <Path Data="M 0,0 L2,0 L 8,6 L8,8"
							  Fill="#ffffff"
							  Margin="1,3,0,0" />
                    </Grid>
                </Border>
                <Border Grid.Column="1"
						Background="Red"
						HorizontalAlignment="Right"
						VerticalAlignment="Center"
						Width="15"
						Height="15"
						Margin="0,0,5,0"
						CornerRadius="10"
						ToolTip="{Binding ElementName=customAdorner, Path=AdornedElement.(Validation.Errors)[0].ErrorContent}">
                    <TextBlock Text="!"
							   VerticalAlignment="center"
							   HorizontalAlignment="center"
							   FontWeight="Bold"
							   Foreground="white">
                    </TextBlock>
                </Border>
            </Grid>
        </ControlTemplate>
    
    <Style TargetType="{x:Type TextBox}">
        <Setter Property="Validation.ErrorTemplate" Value="{StaticResource DefaultErrorTemplate}" />
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="Height" Value="23" />
    </Style>
    <Style TargetType="TextBlock" x:Key="TextBlockStyle">
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="Height" Value="23" />
    </Style>
    <Style TargetType="Image" x:Key="ToolbarImageStyle">
        <Setter Property="Height" Value="24" />
        <Setter Property="Width" Value="24" />
    </Style>
</ResourceDictionary>